package com.lwz.eduservice.client;

import com.lwz.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 服务调用接口
 * @author Lw中
 * @date 2020/11/15 16:08
 * fallback = VodClientImpl.class
 * 当调用出错的时候回调方法进行输出错误信息
 */

@FeignClient(name = "service-vod", fallback = VodClientImpl.class)
@Component
public interface VodClient {

    /**
     * 当前服务调用另一个服务的接口：根据视频id删除视频中的视频
     * @PathVariable中的名称一定要写
     * @param id
     * @return
     */
    @DeleteMapping("/eduvod/video/removeAlyVideo/{id}")
    public R removeAlyVideo(@PathVariable("id") String id);

    /**
     * 删除多个视频
     * @param videoIdList
     * @return
     */
    @DeleteMapping("/eduvod/video/delete-batch")
    public R deleteBatch(@RequestParam("videoIdList") List<String> videoIdList);

}
